﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace NCalculator
{
    [Serializable()]
    public class HistoryContainer
    {
        #region Attributes
        private DateTime _currentTime;
        private List<SingleHistoryLine> _history;
        #endregion

        public HistoryContainer()
        {
            _currentTime = DateTime.Now;
            _history = new List<SingleHistoryLine>();
        }

        public void AddHistoryLine(SingleHistoryLine line)
        {
            if (line != null)
                _history.Add(line);
        }

        /// <summary>
        /// Return all commands executed
        /// </summary>
        public List<SingleHistoryLine> HistoryList
        {
            get { return _history; }
        }

        public override string ToString()
        {
            return string.Format("Created: {0} {1}", _currentTime.ToLongDateString(), _currentTime.ToShortTimeString());
        }
    }
}
